package com.oocl.sc.util;

import java.io.IOException;
import java.util.List;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JSONUtil {
	private static ObjectMapper mapper = new ObjectMapper();

	public static String ObjToStr(Object object) throws JsonProcessingException {
		return mapper.writeValueAsString(object);
	}

	public static Object StrToObj(String str) throws JsonParseException, JsonMappingException, IOException {
       return mapper.readValue(str, List.class);
	}
}
